import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/*
 ID: ning yusui
 LANG: JAVA
 TASK: subset
 */

public class subset {
	static long count(int num) {
		int sum=num*(num+1)/2;
		if(sum%2>0) return 0;
		sum/=2;
		long counts[] = new long[sum+1];
		
		/*����dp*/
		counts[0]=1;
		for(int i=1; i<=num; i++)
		{
			for(int j=sum; j-i>=0; j--)
			{
				/*��Ϊj�Ҹ����ֲ�����i������=��Ϊj�Ҹ����־�С��i������+��Ϊj-i����һ������Ϊi������*/
				counts[j]+=counts[j-i];
			}
		}
		/*ȡ��,��Ϊ��������ֻ��һ��*/
		return counts[sum]/2;
	}

	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(new File("subset.in"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"subset.out")));
		int n = in.nextInt();
		out.println(count(n));
		out.close();
		System.exit(0);
	}
}
